<template>
  <div>
    <Search v-if="$store.getters.userId < 0" />
    <List v-if="ruleList.length" :ruleList="ruleList" />
    <Add v-if="ruleList.length" :ruleList="ruleList" />
  </div>
</template>
<script>
import { tbDictDefinitionQueryEnumList } from '@/api/admin/system/dictionary'
export default {
  components: {
    Search: () => import('./Search.vue'),
    List: () => import('./List.vue'),
    Add: () => import('./Add.vue'),
  },
  data() {
    return {
      ruleList: [],
    }
  },
  mounted() {
    this.queryType()
  },
  methods: {
    queryType() {
      tbDictDefinitionQueryEnumList({ code: 'SCORE_RULE_TYPE' }).then((res) => {
        this.ruleList = res.data.data
      })
    },
  },
}
</script>